/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package l1j.server.server.serverpackets;

import java.util.logging.Logger;

import l1j.server.server.Opcodes;
import l1j.server.server.model.Instance.L1PcInstance;

public class S_WhoCharinfo extends ServerBasePacket {
	private static final String S_WHO_CHARINFO = "[S] S_WhoCharinfo";
	private static Logger _log = Logger
			.getLogger(S_WhoCharinfo.class.getName());

	private byte[] _byte = null;

	public S_WhoCharinfo(L1PcInstance pc) {
		_log.fine("Who charpack for : " + pc.getName());
		
			String msg = "";
				if (pc.isGm())
					msg = "GM";
				else if (pc.isCrown())
				msg = "王族";  
				else if (pc.isKnight())
				msg = "騎士";
				else if (pc.isElf()) 
				msg = "妖精";
				else if (pc.isWizard())
				msg = "法師";
				else if (pc.isDarkelf())
				msg = "黑妖";
				else if (pc.isDragonKnight())
				msg = "龍騎士";
				else if (pc.isIllusionist())
				msg = "幻術士";

				writeC(Opcodes.S_OPCODE_SYSMSG);
				writeC(0x08);
			writeS(" 【血盟: " + pc.getClanname()+ "】  【職業: " + msg + "】 ");

		// writeD(0x80157FE4);
			writeD(0);

	}

	@Override
	public byte[] getContent() {
		if (_byte == null) {
			_byte = _bao.toByteArray();
		}
		return _byte;
	}

	@Override
	public String getType() {
		return S_WHO_CHARINFO;
	}
}
